package com.sdjenkins.lab;

import java.awt.*;
import javax.swing.*;
import javax.swing.table.DefaultTableModel;


public class Main {

    /**
     * @param args
     */
    public static void main(String[] args) throws Exception {

        init();

       

    }

   
   
    private static void init() throws Exception {
       
        JFrame frame = new JFrame("My App");
        Container fcon = frame.getContentPane();
       
        UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
        frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        BorderLayout bl = new BorderLayout();
        JPanel pan = new JPanel();
        //pan.setBackground(Color.LIGHT_GRAY);
        pan.setPreferredSize(new Dimension(200, 40));
        fcon.setLayout(bl);
        frame.setBounds(50, 100, 600, 300);
        fcon.add(getW1(),BorderLayout.CENTER);
        fcon.add(pan, BorderLayout.SOUTH);
        //pan.add(new JButton());
        frame.setVisible(true);

       
       
       
       
       
       
       
       
    }
   
    private static Component getW1() {
       
   
       
        DefaultTableModel mod = new DefaultTableModel();
       
        mod.setColumnIdentifiers(new Object[] { "Date", "Agent", "Agency", "Job Ref", "Company"});
        mod.addRow(new Object[] {"2010.08.10", "Fred Bloggs", "Jobs R Us", "J001", "Shell"});
        mod.addRow(new Object[] {"2010.08.11", "Mary Lamb", "Jobs R Us", "J002", "Shell"});       
        mod.addRow(new Object[] {"2010.08.12", "Eric Cire", "Java Jobs", "J003", "Shell"});       
        mod.addRow(new Object[] {"2010.08.12", "E C", "Java Jobs", "J004", "Shell"});       
              
        JTable tab = new JTable(mod);
        JScrollPane sp = new JScrollPane();
        sp.setViewportView(tab);
        tab.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
        tab.setCellSelectionEnabled(false);
        tab.setShowGrid(true);
        return sp;
       
    }
   
}